package com.orc.fw._admin.menu;

import java.util.List;

import com.jfinal.plugin.ehcache.CacheKit;
import com.orc.fw._admin.common.model.Menu;

public class MenuService {
	public static final MenuService me = new MenuService();
	final static Menu dao = new Menu().dao();

	public List<Menu> getList(Object id){
		List<Menu> list = CacheKit.get("menu"+id, "menuList");
		if(null == list){
			id = null == id ? 0 : id;
			list = dao.find(dao.getSql("menu.getMenuList"),id); 
			for(Menu m : list){
				m.put("sub",getList(m.get("id")));
			}
			CacheKit.put("menu"+id, "menuList", list);
		}
		return list;
	}
}
